OPC Unified Architecture is a rich specification that allows the participating software use different approaches and parameters to achieve their goals. As a result, there is large number of variable settings that can be tweaked to influence the performance, or achieve full interoperability.
OPC Studio for OPC UA attempts to determine many of these setting automatically, and also exposes the most important ones to the developer by means of properties on the various OPC Studio objects. As long as this approach works well for your application, you do not have to do anything extra to configure the OPC UA application.
For the communication layer of the OPC UA, OPC Studio relies on OPC UA .NET (stack and) SDK code from OPC Foundation. The OPC UA SDK uses an application configuration object with various settings. OPC Studio creates this application configuration object and provides it to the OPC UA .NET SDK. More specifically, it performs following sequence of steps:
If you need to change something in the .NET SDK configuration from your code, the recommended approach is to use the configuration property overrides. This allows you to make targeted changes to specific settings, and is also more likely to remain compatible with future changes to the OPC UA .NET SDK. The other possible approach (with using an external file to supply the entire configuration) should be reserved for special cases that cannot be done otherwise.
You can override the value of one or more selected application configuration properties. Such configuration property overrides are specified using the ConfigurationPropertyOverrides Property. For OPC UA client applications, this property is in EasyUAClient.SharedParameters.EngineParameters. For OPC UA server applications, this property is in EasyUAServer.SharedParameters.EngineParameters.
The ConfigurationPropertyOverrides Property contains a dictionary, where the key is the name of the property in the application configuration object (or property "path", in case of nested properties), and the value is the new value you want to give to the specified application configuration property.
The individual application configuration properties are given by the underlying software - in this case, the OPC UA .NET libraries from OPC Foundation. You will need understanding of the OPC UA .NET stack and SDK in order to modify these properties.
For convenience, we have generated a reference documentation for the types used in application configuration. The content of the documentation comes from the libraries themselves.
If you want to override some configuration properties, your starting point will be the ApplicationConfiguration Class. There are properties of this class that hold additional sub-objects for various segments of the application functionality. For example, if you are developing a an OPC UA server, many server-related behaviors will be configured in the ServerConfiguration Property, which holds an instance of the ServerConfiguration Class.
When overriding a nested property, use a dot ('.') to separate the parent and the child. For example, use "ServerConfiguration.MaxSessionCount" to address and override the MaxSessionCount Property in the application configuration.
When OPC Studio constructs the initial application configuration, it can consider one or more configuration sources. OPC Studio takes the enabled configuration sources in order, and the first configuration source that is able to provide the application configuration is used. The particular configuration sources are described further below, and are examined in this order:
It is an error if no configuration source is available.
The flags determining which application configuration sources are enabled are in the ConfigurationSources property. For OPC UA client applications, this property is in EasyUAClient.SharedParameters.EngineParameters. For OPC UA server applications, this property is in EasyUAServer.SharedParameters.EngineParameters.
You will not normally use this configuration source. This configuration source provides an empty application configuration object. Many settings do not have suitable value in the empty application configuration. Consequently, a useable application configuration can be derived from the empty configuration source by explicitly overriding many properties in your own application, and you will need a detailed knowledge of the application configuration object to do so properly.
This is the most commonly used configuration source. It provides an application configuration object automatically pre-filled with settings that OPC Studio has determined as appropriate for the application (OPC UA client or OPC UA server). Some of the settings are constant, and some depend on the application and its operating environment.
With this configuration source, the initial application configuration is defined in a separate configuration file. The name or path of the application configuration file can be specified in the "app.config" file for the .NET application; if not specified, it defaults to the name of the application executable, but with a ".config.xml" extension instead.
If, for any reason, you need to change parameters that cannot be influenced using various properties on OPC Studio objects, you can decide to provide the whole set of parameters yourself. To do so, make sure that the ConfigurationSources property contains the UAConfigurationSources.AppConfig flag set (in the default value setting, this bit is set, together with UAConfigurationSources.Internal).
With this setting on, the whole set of parameters for OPC UA .NET Stack and SDK becomes accessible to you. You can find the description of how to configure the .NET Stack and SDK parameters here: OPC UA .NET SDK Configuration .
When the UAConfigurationSources.Internal flag is set as well, a failure to load the UA configuration from file causes OPC Studio to determine and provide all configuration parameters automatically, which is therefore the default behavior if no UA configuration file is present.